home *** CD-ROM | disk | FTP | other *** search
/ Power Hacker 2003 / Power_Hacker_2003.iso / Exploit and vulnerability / w00w00 / sectools / dsniff / decode_telnet.c < prev    next >
Encoding:
C/C++ Source or Header  |  2000-05-16  |  464 b   |  31 lines

  1. /*
  2.   decode_telnet.c
  3.  
  4.   Telnet.
  5.   
  6.   Copyright (c) 2000 Dug Song <dugsong@monkey.org>
  7.   
  8.   $Id: decode_telnet.c,v 1.1 2000/05/16 17:31:14 dugsong Exp $
  9. */
  10.  
  11. #include <sys/types.h>
  12. #include <stdio.h>
  13. #include <string.h>
  14. #include "options.h"
  15. #include "decode.h"
  16.  
  17. int
  18. decode_telnet(u_char *buf, int len)
  19. {
  20.     if (!strip_telopts(buf, len))
  21.         return (0);
  22.     
  23.     if (strip_lines(buf, Opt_lines) < 2)
  24.         return (0);
  25.     
  26.     strlcpy(Buf, buf, sizeof(Buf));
  27.     
  28.     return (strlen(Buf));
  29. }
  30.  
  31.